package com.i72.governance.annotation;



import com.i72.basic.enums.RPCProtocolEnum;
import com.i72.governance.init.GovernanceConfiguration;

import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({GovernanceConfiguration.class})
@Inherited //将该注解设置为可继承，因为他必须传给子类。spring boot 会代理启动类。所以他必须可继承，不然配置会丢掉
public @interface EnableGovernance {

    /**
     * 是否注册
     * @return
     */
    boolean register() default true;

    /**
     * 是否订阅
     * @return
     */
    boolean subscribe() default true;

    /**
     * RPC的实现类型
     * RPCProtocolEnum
     * @return
     */
    String protocol() default "HTTP";
}
